<template>
	<div id="chart">测试</div>
</template>
<script>
import Plotly from "plotly.js-dist-min";
export default {
	data() {
		return {}
	},
	onLoad() {
		console.log(`helloworld`);
	},
	mounted() {
		const root = document.getElementById("chart");
		Plotly.newPlot(
			root,
			[
				{
					x: [1, 2, 3, 4, 5],
					y: [1, 2, 4, 8, 16],
				},
			],
			{
				margin: { t: 0 },
			},
		);
	}
}
</script>
<style lang="scss">
html,
body {
	margin: 0;
	padding: 0;
}

#chart {
	height: 100vh;
}
</style>